package chenjun.mydatabindingdemo.activity;

import android.app.Activity;
import android.content.Intent;
import android.databinding.DataBindingUtil;
import android.databinding.ViewDataBinding;
import android.os.Bundle;

import chenjun.mydatabindingdemo.BR;
import chenjun.mydatabindingdemo.R;
import chenjun.mydatabindingdemo.bean.JokeBean;
import chenjun.mydatabindingdemo.util.Logger;

public class JokeDetailActivity extends BaseActivity {

    private Activity context;
    private ViewDataBinding binding;
    private JokeBean.ResultBean.DataBean databean;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        context = this;
        binding = DataBindingUtil.setContentView(context, R.layout.activity_joke_detail);
        initIntent();
        if (databean != null)
            binding.setVariable(BR.databean1,databean);
    }

    private void initIntent() {
        if (getIntent()!= null){
            Intent intent = getIntent();
            databean = intent.getParcelableExtra("datebean");
            Logger.i("initIntent:"+databean.toString());
        }
    }

    @Override
    protected void setView() {

    }

    @Override
    protected void setListener() {

    }

    @Override
    protected void initViews() {

    }

    @Override
    protected void initData() {

    }
}
